home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2000 October / Macworld CD 17.10.iso / pc / Data / Shareware / Utilities / KeyQuencer Lite 2.5.5 Installer / Developer Toolkit / Common Code / Extension.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-09-29  |  1.5 KB  |  64 lines  |  [TEXT/CWIE]

  1. //==============================================================================
  2. // DOCUMENTATION AVAILABLE IN THE EXTENSION.H AND ACTION.H HEADERS
  3.  
  4. #include "A4Globals.h"
  5. #include "Extension.h"
  6. #include "Action.h"
  7.  
  8. //==============================================================================
  9. // DEFAULT CALLING CONVENTIONS AND SETUP CODE
  10. // (may be overridden for demo versions)
  11.  
  12. #ifndef KQ_EXTENSION_MAIN
  13. #define KQ_EXTENSION_MAIN \
  14.     pascal short main(long message, ParamsPtr params, MachineHandle mac, GluePtr glue)
  15. #endif
  16.  
  17. #ifndef KQ_EXTENSION_SETUP
  18. #define KQ_EXTENSION_SETUP(eMessage, eParams, eGlue)
  19. #endif
  20.  
  21. //==============================================================================
  22. // MAIN ENTRY POINT AND MESSAGE DISPATCHER
  23.  
  24. KQ_EXTENSION_MAIN
  25. {
  26.     long    world;
  27.     short    error;
  28.     
  29.     MAIN_SETUP_GLOBALS(world);
  30.     KQ_EXTENSION_SETUP(message, params, glue);
  31.     switch(message)
  32.     {
  33.         case kExtMessageRun:
  34.             error = run(params, mac, glue);
  35.             break;
  36.         case kExtMessageInit:
  37.             error = init(params, mac, glue);
  38.             break;
  39.         default:
  40.             error = kTellBadEnvironment;
  41.             break;
  42.     }
  43.     MAIN_RESTORE_GLOBALS(world);
  44.     return error;
  45. }
  46.  
  47. //==============================================================================
  48. // GLOBAL STORAGE FOR TRAP PATCHES AND CALLBACKS (see Action.h)
  49.  
  50. long SetupExtensionWorld(void)
  51. {
  52.     long    world;
  53.     
  54.     TEMP_SETUP_GLOBALS(world);
  55.     return world;
  56. }
  57.  
  58. void RestoreExtensionWorld(long world)
  59. {
  60.     TEMP_RESTORE_GLOBALS(world);
  61. }
  62.  
  63. //==============================================================================
  64.